﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ugrow_silverlight
{
    public partial class Register_content : UserControl
    {
        public Register_content()
        {
            InitializeComponent();
            App.Current.Host.Content.Resized += new EventHandler(Content_Resized);
        }

        void Content_Resized(object sender, EventArgs e)
        {

            this.Width = App.Current.Host.Content.ActualWidth;
            this.Height = App.Current.Host.Content.ActualHeight;

        }

        private void l_cancel_MouseEnter(object sender, MouseEventArgs e)
        {
            Cursor = Cursors.Hand;
            l_cancel.Foreground = new SolidColorBrush(Colors.Orange);
        }

        private void l_cancel_MouseLeave_1(object sender, MouseEventArgs e)
        {
            Cursor = Cursors.Arrow;
            l_cancel.Foreground = new SolidColorBrush(Colors.Black);
        }

        private void l_ok_MouseEnter(object sender, MouseEventArgs e)
        {
            Cursor = Cursors.Hand;
            l_ok.Foreground = new SolidColorBrush(Colors.Orange);
        }

        private void l_ok_MouseLeave(object sender, MouseEventArgs e)
        {
            Cursor = Cursors.Arrow;
            l_ok.Foreground = new SolidColorBrush(Colors.Black);
        }

        private void l_ok_KeyDown(object sender, KeyEventArgs e)
        {
            //TODO: CHAMAR METODO QUE FAZ O REGISTO
        }

        private void l_cancel_KeyDown(object sender, KeyEventArgs e)
        {
           
        }

        private void l_cancel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            tb_checkpass.Password = "";
            tb_email.Text = "";
            tb_firstname.Text = "";
            tb_kitcode.Text = "";
            tb_lastname.Text = "";
            tb_pass.Password = "";
            this.Visibility = System.Windows.Visibility.Collapsed;
        }

        private void l_ok_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            register_thanks1.Visibility = System.Windows.Visibility.Visible;
            register_thanks1.CloseNexts();

        }

        public void clearFields()
        {
            tb_checkpass.Password = "";
            tb_email.Text = "";
            tb_firstname.Text = "";
            tb_kitcode.Text = "";
            tb_lastname.Text = "";
            tb_pass.Password = "";
        }
    }
}
